<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="../../js/plugins/layui-v2.4.5/layui/css/layui.css" />
		<link rel="stylesheet" href="../../css/reset.css" />
		<link rel="stylesheet" href="../../css/list.css" />
	</head>
	<body  class="p10">
		<div class="container p15">
			<div class="btn-container"><a href="javascript:;" id="addBtn" class="layui-btn layui-btn-sm">添加</a></div>
			<table id="list" lay-filter="list"></table>
		</div>
		<script src="../../js/jquery-3.3.1.min.js"></script>
		<script src="../../js/plugins/layui-v2.4.5/layui/layui.js"></script>
		<script>
			var data = [
						{id:'001',name:'交换机'},
						{id:'002',name:'其它'}
					];
			layui.use(['table'],function(){
				var table = layui.table;
				//第一个实例
				  table.render({
					elem: '#list'
					,height: '300'
					,url: '' //数据接口
					,page: true //开启分页
					,cols: [[ //表头
					  {field: 'xh', title: '序号', width:80,align:'center'
					  ,templet:function(d){
						  return d.LAY_INDEX;
					  }}
					  ,{field: 'id', title: 'ID',align:'center'}
					  ,{field: 'name', title: '分类名',align:'center'}
					  ,{field: 'opt', title: '操作', width: 160,align:'center'
					  ,templet:function(d){
						  return `<a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>编辑</a>
						  &nbsp;<a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>删除</a>`
					  }}
					]]
					,data: data
				  });
			})
		</script>
	</body>
</html>
